package com.hd.common.page.impl;

import java.util.List;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import com.hd.common.page.Page;
import com.ibatis.sqlmap.client.SqlMapException;

/**
 * <p>Title:</p>
 * <p>Description:</p>
 * <p>copyright:</p>
 * <p>Date: 2008-12-1</p>
 * @version V1.0
 * @amendment history:
 */
public class IbatisPage extends BasePage implements Page{
	public IbatisPage(SqlMapClientTemplate smct,String statementName,Object parameterObject,int totalElementsCount,int pageNumber, int pageSize) {
		try {
			init(pageNumber, pageSize, totalElementsCount);
			this.elements = smct.queryForList(statementName, parameterObject,
					getThisPageFirstElementNumber()-1, pageSize);
		} catch (SqlMapException e) {
			throw new RuntimeException(e);
		}
	}
}
